<script type="text/html" template>
    <link rel="stylesheet" href="{{ layui.setter.base }}style/print.css?v={{ layui.setter.version }}" media="all">
</script>
<style type="text/css">
    .form-input-underscore .layui-form-label{
        white-space:pre;
        color: #000;
        background-color: #fff;
        text-align: left;
    }
    .form-input-underscore .layui-input-block{
        min-height: 32px;
    }
    tr.highlight td{
        color: #0ba9f9 !important;
    }
</style>
<div class="child-box pb50">
    <div class="layui-card layadmin-header print-hide">
        <div class="layui-breadcrumb" lay-filter="breadcrumb">
            <a href="javascript:" lay-href=""><i class="iconfont iconhome"></i>首页</a>
            <a><cite>客户中心</cite></a>
            <a><cite>协议签约</cite></a>
            <div class="layui-card-header-left" title="刷新" zmark-event="layui.manage.render">
                <i class="layui-icon layui-icon-refresh layui-anim" zmark-anim="layui-anim-rotate"></i>
            </div>
        </div>
    </div>
    <div class="layui-card mt20">
        <div class="layui-card-header print-hide">
            <span class="def-fc left-split">协议签约</span>
        </div>
        <div class="layui-card-body">
            <div id="signAgreement" class="print-area">
                <form class="layui-form form-input-underscore" method="post" lay-filter="form-sign-agreement" id="form-sign-agreement"  method="post" onsubmit="return false">
                    <input type="hidden" name="id"/>
                    <input type="hidden" name="docNo"/>
                    <div id="agreement-box" class="page-break init-hide f13 zm-hide">
                        <div class="head">
                            <div class="title22">供应链服务协议</div>
                        </div>
                        <div class="layui-row mt10">
                            <div class="layui-col-xs8 pr10">
                                <label class="layui-form-label"></label>
                                <div class="layui-input-block"></div>
                            </div>
                            <div class="layui-col-xs4 pr10">
                                <label class="layui-form-label">协 议 编 号：</label>
                                <div class="layui-input-block">
                                    <input name="docNo" class="layui-input" disabled/>
                                </div>
                            </div>
                        </div>
                        <div class="layui-row mt10">
                            <div class="layui-col-xs6 pr10">
                                <label class="layui-form-label">甲          方：</label>
                                <div class="layui-input-block">
                                    <input name="partyaName" class="layui-input" disabled/>
                                </div>
                            </div>
                            <div class="layui-col-xs6 pr10">
                                <label class="layui-form-label" style="min-width: 130px;">统一社会信用代码：</label>
                                <div class="layui-input-block" style="margin-left: 140px">
                                    <input name="partyaSocialNo" class="layui-input" disabled/>
                                </div>
                            </div>
                        </div>
                        <div class="layui-row" style="display: none">
                            <div class="layui-col-xs6 pr10">
                                <label class="layui-form-label">芯达通账号（ID）：</label>
                                <div class="layui-input-block">
                                    <input name="partyaAccountNo" class="layui-input" disabled/>
                                </div>
                            </div>
                            <div class="layui-col-xs6 pr10">
                                <label class="layui-form-label">授权联系人：</label>
                                <div class="layui-input-block">
                                    <input name="partyaLinkPerson" id="input-partyaLinkPerson" class="layui-input" style="background-color: #fbffd5"/>
                                </div>
                            </div>
                        </div>
                        <div class="layui-row">
                            <div class="layui-col-xs12 pr10">
                                <label class="layui-form-label">联 系 地 址：</label>
                                <div class="layui-input-block">
                                    <input name="partyaAddress" class="layui-input" disabled/>
                                </div>
                            </div>
                        </div>
                        <div class="layui-row" style="display: none">
                            <div class="layui-col-xs6 pr10">
                                <label class="layui-form-label">电子邮箱：</label>
                                <div class="layui-input-block">
                                    <input name="partyaMail" id="input-partyaMail" class="layui-input" style="background-color: #fbffd5"/>
                                </div>
                            </div>
                        </div>
                        <div class="layui-row">
                            <div class="layui-col-xs6 pr10">
                                <label class="layui-form-label">电          话：</label>
                                <div class="layui-input-block">
                                    <input name="partyaTel" class="layui-input" disabled/>
                                </div>
                            </div>
                            <div class="layui-col-xs6 pr10">
                                <label class="layui-form-label">传          真：</label>
                                <div class="layui-input-block">
                                    <input name="partyaFax" class="layui-input" disabled/>
                                </div>
                            </div>
                        </div>


                        <div class="layui-row">
                            <div class="layui-col-xs6 pr10">
                                <label class="layui-form-label">乙          方：</label>
                                <div class="layui-input-block">
                                    <input name="partybName" class="layui-input" disabled/>
                                </div>
                            </div>
                            <div class="layui-col-xs6 pr10">
                                <label class="layui-form-label" style="min-width: 130px;">统一社会信用代码：</label>
                                <div class="layui-input-block" style="margin-left: 140px">
                                    <input name="partybSocialNo" class="layui-input" disabled/>
                                </div>
                            </div>
                        </div>
                        <div class="layui-row">
                            <div class="layui-col-xs12 pr10">
                                <label class="layui-form-label">注 册 地 址：</label>
                                <div class="layui-input-block">
                                    <input name="partybRegAddress" class="layui-input" disabled/>
                                </div>
                            </div>
                        </div>
                        <div class="layui-row">
                            <div class="layui-col-xs12 pr10">
                                <label class="layui-form-label">办 公 地 址：</label>
                                <div class="layui-input-block">
                                    <input name="partybAddress" class="layui-input" disabled/>
                                </div>
                            </div>
                        </div>
                        <div class="layui-row">
                            <div class="layui-col-xs6 pr10">
                                <label class="layui-form-label">法定代表人：</label>
                                <div class="layui-input-block">
                                    <input name="partybLegalPerson" class="layui-input" disabled/>
                                </div>
                            </div>
                            <div class="layui-col-xs6 pr10">
                                <label class="layui-form-label">电          话：</label>
                                <div class="layui-input-block">
                                    <input name="partybTel" class="layui-input" disabled/>
                                </div>
                            </div>
                        </div>
                        <div class="layui-row" id="agrement-context">

                        </div>
                        <div class="layui-row mt10" style="line-height: 28px;display: none">
                            <div class="layui-col-xs6 pr10" style="padding-left: 15px">
                                <div class="layui-row">
                                    <h3 class="f14b">甲方：<span class="span-partya-name"></span></h3>
                                </div>
                                <div class="layui-row f14">
                                    授权代表人：
                                </div>
                                <div class="layui-row f14">
                                    签字：
                                </div>
                                <div class="layui-row f14">
                                    盖章：
                                </div>
                                <div class="layui-row f14">
                                    日期：
                                </div>
                            </div>
                            <div class="layui-col-xs6 pr10"  style="padding-left: 15px">
                                <div class="layui-row">
                                    <h3 class="f14b">乙方：<span class="span-partyb-name"></span></h3>
                                </div>
                                <div class="layui-row f14">
                                    授权代表人：
                                </div>
                                <div class="layui-row f14">
                                    签字：
                                </div>
                                <div class="layui-row f14">
                                    盖章：
                                </div>
                                <div class="layui-row f14">
                                    日期：
                                </div>
                            </div>
                        </div>
                    </div>
                    <div id="quote-box" class="page-break init-hide f13 zm-hide">
                        <div class="head">
                            <div class="title22">一般贸易进口服务报价单</div>
                        </div>
                        <div class="layui-row mt10">
                            <div class="layui-col-xs6 pr10">
                                <label class="layui-form-label">甲          方：</label>
                                <div class="layui-input-block">
                                    <input name="partyaName" class="layui-input" disabled/>
                                </div>
                            </div>
                            <div class="layui-col-xs6 pr10">
                                <label class="layui-form-label" style="min-width: 130px;">统一社会信用代码：</label>
                                <div class="layui-input-block" style="margin-left: 140px">
                                    <input name="partyaSocialNo" class="layui-input" disabled/>
                                </div>
                            </div>
                        </div>
                        <div class="layui-row">
                            <div class="layui-col-xs12 pr10">
                                <label class="layui-form-label">联 系 地 址：</label>
                                <div class="layui-input-block">
                                    <input name="partyaAddress" class="layui-input" disabled/>
                                </div>
                            </div>
                        </div>
                        <div class="layui-row">
                            <div class="layui-col-xs6 pr10">
                                <label class="layui-form-label">乙          方：</label>
                                <div class="layui-input-block">
                                    <input name="partybName" class="layui-input" disabled/>
                                </div>
                            </div>
                            <div class="layui-col-xs6 pr10">
                                <label class="layui-form-label" style="min-width: 130px;">统一社会信用代码：</label>
                                <div class="layui-input-block" style="margin-left: 140px">
                                    <input name="partybSocialNo" class="layui-input" disabled/>
                                </div>
                            </div>
                        </div>
                        <div class="layui-row">
                            <div class="layui-col-xs12 pr10">
                                <label class="layui-form-label">联 系 地 址：</label>
                                <div class="layui-input-block">
                                    <input name="partybAddress" class="layui-input" disabled/>
                                </div>
                            </div>
                        </div>
                        <div class="layui-row arg" style="padding-top: 10px">
                           <p>&nbsp;基于甲乙双方在签署《供应链服务协议》基础上，双方友好协商约定税票类型和服务收费达成如下报价单：</p>
                        </div>
                        <div class="layui-row print-tab h26 mt10" id="view-agr-quote">

                        </div>
                        <div class="layui-row mt10" style="line-height: 28px;display: none">
                            <div class="layui-col-xs6 pr10" style="padding-left: 15px">
                                <div class="layui-row">
                                    <h3 class="f14b">甲方：<span class="span-partya-name"></span></h3>
                                </div>
                                <div class="layui-row f14">
                                    授权代表人：
                                </div>
                                <div class="layui-row f14">
                                    签字：
                                </div>
                                <div class="layui-row f14">
                                    盖章：
                                </div>
                                <div class="layui-row f14">
                                    日期：
                                </div>
                            </div>
                            <div class="layui-col-xs6 pr10"  style="padding-left: 15px">
                                <div class="layui-row">
                                    <h3 class="f14b">乙方：<span class="span-partyb-name"></span></h3>
                                </div>
                                <div class="layui-row f14">
                                    授权代表人：
                                </div>
                                <div class="layui-row f14">
                                    签字：
                                </div>
                                <div class="layui-row f14">
                                    盖章：
                                </div>
                                <div class="layui-row f14">
                                    日期：
                                </div>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <div class="layui-card child-box-footer normal t-a-r pr20">
        <button type="button" class="layui-btn init-hide zm-hide" id="agreeSign" disabled><i class="iconfont iconicon-1"></i>同意并签署</button>
        <div class="init-hide zm-hide" id="down-print-box">
            <a href="javascript:" class="layui-btn" target="_blank" id="down-agreement"><i class="iconfont iconpdf"></i>下载打印服务协议</a>
<!--            <a href="javascript:" class="layui-btn" target="_blank" id="down-quote"><i class="iconfont iconpdf"></i>下载打印报价单</a>-->
        </div>
    </div>
</div>
<script type="text/html" id="tpl-agr-quote">
    <table style="margin-bottom: 9px">
        <tbody>
        <tr class="highlight">
            <td width="120">税单类型</td>
            <td colspan="3">
                <div class="zm-checkbox-area">
                    <input type="text" name="businessType" id="businessType" value="{{layui.com.removeNull(d[0].agreementBusinessType)}}" style="width: 1px;height: 1px;border: none;opacity: 0.1"/>
                    <input type="hidden" name="agreementId" value="{{layui.com.removeNull(d[0].agreementId)}}"/>
                    {{# if(layui.com.isEmpty(d[0].agreementBusinessType)){ }}
                    <label class="zm-checkbox" z-value="imp_agent"><i class="iconfont"></i>服务类增值税专用发票（双抬头）</label>
                    <label class="zm-checkbox" z-value="imp_cooperate"><i class="iconfont"></i>销售货物类增值税专用发票（单抬头）</label>
                    {{# }else if(d[0].agreementBusinessType == 'imp_agent'){ }}
                    <label class="zm-checkbox checked" z-value="imp_agent"><i class="iconfont"></i>服务类增值税专用发票（双抬头）</label>
                    {{# }else if(d[0].agreementBusinessType == 'imp_cooperate'){ }}
                    <label class="zm-checkbox checked" z-value="imp_cooperate"><i class="iconfont"></i>销售货物类增值税专用发票（单抬头）</label>
                    {{# } }}
                </div>
            </td>
        </tr>
        </tbody>
    </table>
    {{# layui.each(d,function(i,o){ }}
    <table style="margin-top: -1px">
        <tbody>
        <tr>
            <td width="120" class="bg">业务类型</td>
            <td class="f14b bg">{{o.quoteTypeDesc}}</td>
            <td width="120" class="bg">计费模式</td>
            <td class="f14b bg">{{o.agencyFeeModeDesc}}</td>
        </tr>
        <!--按重计费-->
        {{# if(o.agencyFeeMode == 'express'){ }}
        <tr>
            <td colspan="4" style="padding: 0">
                <table class="inline">
                    <tbody>
                        <tr>
                            <td width="119">重量限制KG</td>
                                {{# let weight = 200,price = 0.0,basePrice = 0.0,priceRes = 0.0,cappedFee=0.0;}}
                            {{# layui.each(o.expressQuoteList,function(j,k){ }}
                                {{# if(k.endWeight >= weight && priceRes == 0.0){price = k.price;basePrice=k.basePrice;priceRes = weight * k.price + k.basePrice;} }}
                                {{# if(k.capped){ cappedFee = k.cappedFee; } }}
                            {{# if(j<o.expressQuoteList.length-1){ }}
                            <td>≤{{k.endWeight}}kg</td>
                            {{# }else{ }}
                            <td>>{{k.startWeight}}kg</td>
                            {{# } }}
                            {{# }); }}
                        </tr>
                        <tr>
                            <td width="119">价格RMB/KG</td>
                            {{# layui.each(o.expressQuoteList,function(j,k){ }}
                            <td>{{layui.com.formatCurrency(k.price)}}</td>
                            {{# }); }}
                        </tr>
                        <tr>
                            <td width="119">基准价</td>
                            {{# layui.each(o.expressQuoteList,function(j,k){ }}
                            <td>{{layui.com.formatCurrency(k.basePrice)}}</td>
                            {{# }); }}
                        </tr>
                    </tbody>
                </table>
            </td>
        </tr>
        <tr>
            <td colspan="4" style="text-align: center">
                服务费=重量x区间每千克价格+基准价；
                如重量{{weight}}KG，则价格为{{weight}}*{{layui.com.formatCurrency(price)}}+{{layui.com.formatCurrency(basePrice)}}={{layui.com.formatCurrency(priceRes)}}。
                {{# if(cappedFee>0){ }}
                    <span class="f14b">封顶价：{{cappedFee}}/单</span>
                {{# } }}
            </td>
        </tr>
        <tr>
            <td colspan="4" style="padding: 0">
                <table class="inline">
                    <tbody>
                        <tr>
                            <td width="119" class="bg">运输保险</td>
                            <td colspan="2" class="bg"></td>
                        </tr>
                        <tr>
                            <td width="119">货值</td>
                            <td>≤1万RMB</td>
                            <td>>1万RMB</td>
                        </tr>
                        <tr>
                            <td width="119">保险费率</td>
                            <td>10.00/单</td>
                            <td>10.00+货值*0.015%</td>
                        </tr>
                    </tbody>
                </table>
            </td>
        </tr>
        <tr>
            <td class="bg">香港出口海关税金</td>
            <td colspan="3" class="bg">仅适用于香港出口至中国大陆</td>
        </tr>
        <tr>
            <td colspan="4" style="padding: 0">
                <table class="inline">
                    <tbody>
                    <tr>
                        <td width="119">货值</td>
                        <td>≤1万RMB</td>
                        <td>>1万RMB</td>
                    </tr>
                    <tr>
                        <td width="119">税金</td>
                        <td>15.00/单</td>
                        <td>15.00+货值*0.0125%</td>
                    </tr>
                    </tbody>
                </table>
            </td>
        </tr>
        {{# }else{ }}
        <tr>
            <td width="120">服务费</td>
            <td colspan="3">
                {{# if(o.basePrice > 0){ }} {{layui.com.formatCurrency(o.basePrice)}}RMB/单 + {{# } }}
                （报关金额 * 海关汇率{{# if(o.taxType=='after_tax'){ }} + 税款{{# } }}) * {{o.serviceRate}}%
                {{# if(o.minCost > 0){ }} 最低消费:{{layui.com.formatCurrency(o.minCost)}}RMB {{# } }}
            </td>
        </tr>
        {{# } }}
        <!--预付款业务-->
        {{# if(o.quoteType == 'advance_charge'){ }}
            <tr>
                <td width="120">付款期限及方式</td>
                <td colspan="3">
                    甲方需在乙方进口申报前将服务费及预估的进口关税、增值税、物流杂费、运保费等各项费用总额以网银转账的方式支付人民币给乙方，实际费用以进口后确定的金额为准，差额部分需进口后7个自然日内结清，未收到甲方上述费用前乙方有权拒绝服务。
                </td>
            </tr>
        <!--垫款业务-->
        {{# }else{ }}
        <tr>
            <td width="120">付款期限及方式</td>
            <td colspan="3">
                <p>
                    1、服务费、物流杂费等各项杂费支付日期进口申报
                    {{# if(o.agreeMode == 'import_day'){ }}
                    {{# if(o.day >0 ){ }}后{{o.day}}天内 {{# }else{ }}前{{# } }}
                    {{# }else if(o.agreeMode == 'month'){ }}
                    {{# if(o.month <=0 ){ }}当月 {{# }else{ }}第{{o.month}}个月{{# } }} {{o.monthDay}}号前
                    {{# }else if(o.agreeMode == 'half_month'){ }}
                    1号到15号{{# if(o.firstMonth <=0){ }}当月{{# }else{ }}第{{o.firstMonth}}个月{{# } }}{{o.firstMonthDay}}号前
                    16号到月末{{# if(o.lowerMonth <=0){ }}当月{{# }else{ }}第{{o.lowerMonth}}个月{{# } }}{{o.lowerMonthDay}}号前
                    {{# }else if(o.agreeMode == 'week'){ }}
                    {{# if(o.week <=0){ }}当周{{# }else{ }}第{{o.week}}周后{{# } }}星期{{o.weekDay}}前
                    {{# } }};
                </p>
                <p>
                    2、关税、增值税等各项税费支付日期进口申报
                    {{# if(o.taxAgreeMode == 'import_day'){ }}
                    {{# if(o.taxDay >0 ){ }}后{{o.taxDay}}天内 {{# }else{ }}前{{# } }}
                    {{# }else if(o.taxAgreeMode == 'month'){ }}
                    {{# if(o.taxMonth <=0 ){ }}当月 {{# }else{ }}第{{o.taxMonth}}个月{{# } }} {{o.taxMonthDay}}号前
                    {{# }else if(o.taxAgreeMode == 'half_month'){ }}
                    1号到15号{{# if(o.taxFirstMonth <=0){ }}当月{{# }else{ }}第{{o.taxFirstMonth}}个月{{# } }}{{o.taxFirstMonthDay}}号前
                    16号到月末{{# if(o.taxLowerMonth <=0){ }}当月{{# }else{ }}第{{o.taxLowerMonth}}个月{{# } }}{{o.taxLowerMonthDay}}号前
                    {{# }else if(o.taxAgreeMode == 'week'){ }}
                    {{# if(o.taxWeek <=0){ }}当周{{# }else{ }}第{{o.taxWeek}}周后{{# } }}星期{{o.taxWeekDay}}前
                    {{# } }};
                </p>
                {{# if(o.quoteType == 'pad_good'){ }}
                <p>
                    3、货款支付日期申请付汇
                    {{# if(o.goAgreeMode == 'payment_day'){ }}
                    {{# if(o.goDay >0 ){ }}后{{o.goDay}}天内 {{# }else{ }}前{{# } }}
                    {{# }else if(o.goAgreeMode == 'month'){ }}
                    {{# if(o.goMonth <=0 ){ }}当月 {{# }else{ }}第{{o.goMonth}}个月{{# } }} {{o.goMonthDay}}号前
                    {{# }else if(o.goAgreeMode == 'half_month'){ }}
                    1号到15号{{# if(o.goFirstMonth <=0){ }}当月{{# }else{ }}第{{o.goFirstMonth}}个月{{# } }}{{o.goFirstMonthDay}}号前
                    16号到月末{{# if(o.goLowerMonth <=0){ }}当月{{# }else{ }}第{{o.goLowerMonth}}个月{{# } }}{{o.goLowerMonthDay}}号前
                    {{# }else if(o.goAgreeMode == 'week'){ }}
                    {{# if(o.goWeek <=0){ }}当周{{# }else{ }}第{{o.goWeek}}周后{{# } }}星期{{o.goWeekDay}}前
                    {{# } }};
                </p>
                {{# } }}
                <p>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;请将以上费用总额按照账期约定以网银转账的方式支付人民币给乙方，实际费用以进口后确定的金额为准
                    {{# if(o.overdueRate > 0){ }}
                    ，如未按账期支付则甲方将需支付逾期金额/{{o.overdueRate}}%天滞纳金给乙方
                    {{# } }}
                    ，未收到甲方上述费用前乙方有权拒绝服务。
                </p>
            </td>
        </tr>
        {{# } }}
        </tbody>
        </table>
        {{# }); }}

</script>
<script>
    layui.use('agreement', layui.factory('agreement'));
</script>